using System;
using System.Collections.Generic;
using System.Text;

using SBPweb.Modules.Modularity;

namespace SBPweb.Contracts
{
	/// <summary>
	/// Delegate for EasterEgg callback
	/// </summary>
    public delegate void EggCallBackDelegate();

	/// <summary>
	/// Interface of IEasterEggHandlerService
	/// </summary>
	public interface IEasterEggHandlerService : IService
    {
		/// <summary>
		/// Registers an EasterEgg
		/// </summary>
		/// <param name="keykode">keycode of the EasterEgg</param>
		/// <param name="callBackDelegate">callback delegate</param>
		/// <returns>EasterEgg</returns>
        IEasterEgg RegisterEasterEgg(string keykode, EggCallBackDelegate callBackDelegate);

		/// <summary>
		/// Unregister an EasterEgg
		/// </summary>
		/// <param name="keykode">keycode</param>
        void UnRegisterEasterEgg(string keykode);

		/// <summary>
		/// Unregister an EasterEgg
		/// </summary>
		/// <param name="egg">EasterEgg</param>
        void UnRegisterEasterEgg(IEasterEgg egg);

		/// <summary>
		/// Get all EasterEgg
		/// </summary>
		/// <returns>List of eggs</returns>
        List<IEasterEgg> GetAllEggs();

		/// <summary>
		/// Interval
		/// </summary>
        int Interval
        {
            get;
            set;
        }
    }

	/// <summary>
	/// interface of IEasterEgg
	/// </summary>
	public interface IEasterEgg
    {
		/// <summary>
		/// Keycode of the EasterEgg
		/// </summary>
        string Keykode
        {
            get;
        }

		/// <summary>
		/// Callback delegate for EasterEgg
		/// </summary>
        EggCallBackDelegate CallBackDelegate
        {
            get;
        }
    }
}
